using System;
using System.IO;
using System.Net;
using System.Text;
using Eclipse.TRCore.Delegates;

namespace Eclipse.TRCore.Delegates
{
    public delegate byte[] OnGetResponseStream(Stream netStream);
    public delegate void OnGetRequestStream(Stream netStream, ref bool handled);
}

namespace Eclipse.TRCore.Http
{
    public interface IHttpCapability : IDisposable
    {
        CookieCollection Cookies{ get;}
        WebHeaderCollection ClientHeads { get;}
        WebHeaderCollection ServerHeads { get;}
        bool IsBusy { get;}
        Exception LastException { get;}
        ICredentials Credentials { get; set;}
        Encoding Encoding { get; set;}
        IWebProxy Proxy { get; set;}
        int? ReadWriteTimeout { get; set;}
        int? Timeout { get; set;}
        string Referer { get; set;}
        bool AutoEncoding { get; set;}
        byte[] GetResponseBytes(Uri uri, HttpPostArguments httpPostArguments, OnGetRequestStream GetRequestStreamHandler, OnGetResponseStream GetResponseStreamHandler, bool throwException);
        void AbortRequest();
    }
}
